<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>添加商品 - 系统后台 - {$Config.sitename}</title>
    <link rel="stylesheet" href="__CSS__/admin_inc.css" type="text/css">
    <link rel="stylesheet" href="__JS__/artDialog/skins/default.css" type="text/css">
    <script type="text/javascript">
        //全局变量
        var GV = {
            DIMAUB: "__ROOT__/",
            JS_ROOT: "__JS__/"
        };
    </script>
    <script src="__JS__/wind.js"></script>
    <script src="__JS__/jquery.min.js"></script>
    <script type="text/javascript">
    var cateid = "{$cateid}";
</script>
<style type="text/css">
.col-auto {
	overflow: hidden;
	_zoom: 1;
	_float: left;
	border: 1px solid #c2d1d8;
}
.col-right {
	float: right;
	width: 28%;
	overflow: hidden;
	margin-left: 6px;
	border: 1px solid #c2d1d8;
}

body fieldset {
	border: 1px solid #D8D8D8;
	padding: 10px;
	background-color: #FFF;
}
body fieldset legend {
    background-color: #F9F9F9;
    border: 1px solid #D8D8D8;
    font-weight: 700;
    padding: 3px 8px;
}
.list-dot{ padding-bottom:10px}
.list-dot li,.list-dot-othors li{padding:5px 0; border-bottom:1px dotted #c6dde0; font-family:"宋体"; color:#bbb; position:relative;_height:22px}
.list-dot li span,.list-dot-othors li span{color:#004499}
.list-dot li a.close span,.list-dot-othors li a.close span{display:none}
.list-dot li a.close,.list-dot-othors li a.close{ background: url("__IMAGES__/cross.png") no-repeat left 3px; display:block; width:16px; height:16px;position: absolute;outline:none;right:5px; bottom:5px}
.list-dot li a.close:hover,.list-dot-othors li a.close:hover{background-position: left -46px}
.list-dot-othors li{float:left;width:24%;overflow:hidden;}

    .attr{
        margin: 0px;
        padding: 10px;
        background: bisque;
        border: 1px dotted coral;
    }
    .attr ul{
        display: block;
    }
    .attr ul li{
        margin-top: 5px;
    }
    td.ship input,
    td.ship select{
        margin-bottom: 5px;
    }

    td#mt input{
        margin-top: 3px;
        width: 40%;
    }

    input[type=radio]{
        margin-bottom: 6px;
        border-radius: 8px;
    }
    .opt em{
        display: inline-block;
        margin-left: 10px;
        width: 100px;
        text-align: center;
        height: 80px;
        line-height: 80px;
        font-size: 20px;
        border: 1px solid #c1c1c1;
        background: #f0ead8;
        overflow: hidden;
        cursor: pointer;
    }
    .opt a{
        display: inline-block;
        margin-bottom: 30px;
        overflow: hidden;
    }


</style>
</head>
<body class="J_scroll_fixed">
<div class="wrap J_check_wrap">
<form name="myform" id="myform" action="{:U('TryItems/add')}" method="post" class="J_ajaxForm" enctype="multipart/form-data">
<div class="col-right">
    <div class="table_full">
        <table width="100%">
            <tr>
                <td><b>商品主图</b></td>
            </tr>
            <tr>
                <td><div style="text-align: center;"><Form function="mainimage" parameter="image,image,$data['image'],works"/></div></td>
            </tr>
            <tr>
                <td><b>商家担保金</b></td>
            </tr>
            <tr>
                <td><input type="text" name="memberdbj" class="input"></td>
            </tr>
            <tr>
                <td><b>开始时间</b></td>
            </tr>
            <tr>
                <td><input type="text" name="start_time" class="input J_date" value="{$start_time|date='Y-m-d',###}" style="width:180px;"></td>
            </tr>
            <tr>
                <td><b>结束时间</b></td>
            </tr>
            <tr>
                <td><input type="text" name="end_time" class="input J_date" value="{$end_time|date='Y-m-d',###}" style="width:180px;"></td>
            </tr>
            <tr>
                <td><b>邮寄方式</b></td>
            </tr>
            <tr>
                <td><input type="radio" name="postfee" value="1" checked/>免邮 <input type="radio" name="postfee" value="2"/>收邮 </td>
            </tr>
        </table>
    </div>
</div>
<div class="col-auto">
    <div class="h_a">信息发布</div>
    <div class="table_full">
        <table width="100%">
            <tr>
                <th width="80">栏目<span class="require_red">*</span></th>
                <td><select name="cateid">
                        <foreach name="category" item="ct">
                            <option value="{$ct.cateid}">{$ct.catename}</option>
                        </foreach>
                    </select>
                 </td>
            </tr>
            <tr>
                <th width="80">所属会员<span class="require_red">*</span></th>
                <td><select name="memberid" id="memberid">
                        <foreach name="member" item="mb">
                            <option value="{$mb.id}">{$mb.mname}-{$mb.mtel}</option>
                        </foreach>
                    </select>
                    <input type="text" class="input" id="shtxt" placeholder="请输入手机号"/> <a class="btn" id="searchBytel">手机号查询</a>
                </td>
            </tr>
            <tr>
                <th width="80">名称<span class="require_red">*</span></th>
                <td><input type="text" style="width:320px;" name="title" id="title" class="input input_hd J_title_color" placeholder="请输入产品名称" onkeyup="strlen_verify(this, 'title_len', 80)" />
                    <span>还可输入<B><span id="title_len">80</span></B> 个字符</span> <span></span></td>
            </tr>
            <tr>
                <th>商品价格</th>
                <td><input type="text" name="price" class="input"/></td>
            </tr>
            <tr>
                <th>试用份数</th>
                <td><input type="text" name="trynum" class="input"/></td>
            </tr>
            <tr>
                <th>购买链接</th>
                <td><input type="text" name="buylink" size="80" class="input"/></td>
            </tr>
            <tr>
                <th width="80">内容</th>
                <td><script type="text/plain" id="content" name="content"></script><Form function="editor" parameter="content,basic,$data['content'],item"/> </td>
            </tr>
            <tr>
                <th width="80">状态</th>
                <td>
                    <span class="switch_list cc">
                    <label><input type="radio" name="status" value="1" checked><span>审核</span></label>
                    <label><input type="radio" name="status" value="0"><span>待审核</span></label>
                 </span>
                </td>
            </tr>
            <tr>
                <th width="80">推荐</th>
                <td>
                    <span class="switch_list cc">
                    <label><input type="radio" name="iftj" value="1" ><span>是</span></label>
                    <label><input type="radio" name="iftj" value="0" checked><span>否</span></label>
                 </span>
                </td>
            </tr>
            <tr>
                <th width="80">热门</th>
                <td>
                    <span class="switch_list cc">
                    <label><input type="radio" name="ifhot" value="1"><span>是</span></label>
                    <label><input type="radio" name="ifhot" value="0" checked><span>否</span></label>
                 </span>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
<div class="btn_wrap" style="z-index:999;text-align: center;">
    <div class="btn_wrap_pd">
        <button class="btn btn_submit J_ajax_submit_btn"type="submit">提交</button>
        <button class="btn btn_close J_ajax_close_btn" type="button">关闭</button>
    </div>
</div>
</form>
</div>
<script type="text/javascript" src="__JS__/common.js"></script>
<script type="text/javascript" src="__JS__/content_addtop.js"></script>
<script type="text/javascript"> 
$(function () {
    $(".J_ajax_close_btn").on('click', function (e) {
        e.preventDefault();
        Wind.use("artDialog", function () {
            art.dialog({
                id: "question",
                icon: "question",
                fixed: true,
                lock: true,
                background: "#CCCCCC",
                opacity: 0,
                content: "您确定需要关闭当前页面嘛？",
                ok: function () {
                    setCookie("refersh_time", 1);
                    window.close();
                    return true;
                }
            });
        });
    });
})
    $("#searchBytel").on('click',function(e){
        var keyworks = $("#shtxt").val(),
            memberid=$("#memberid").val(),
            opstr='';
        //检查是否有上传权限
        $.ajax({
            type: "GET",
            url: GV.DIMAUB + 'index.php?a=checktel&c=TryItems&m=Admins&shtxt='+keyworks,
            dataType: "json",
            async: false,
            success: function (data) {
                if(data.status==true){
                    $("#memberid option").remove();
                    $.each(data.datas, function (i, o) {
                          opstr += '<option value='+ o.id+'>'+o.mname+'-'+ o.mtel+'</option>'
                     //   html.push('<li><a href="" title="' + o.name + '" data-id="' + o.id + '">' + o.name + '</a></li>');
                    });

                   // var str='<option>kkkkk</option>'
                    $("#memberid").append(opstr);
                }else{
                    return false;
                }
            }
        });

    })

</script>
</body>
</html>